﻿//-----------------------------------------------------------------------
// <copyright file="CommandListEditor.xaml.cs" author="Artak Mkrtchyan">
//     Creative Commons - GNU General Public License (http://creativecommons.org/licenses/GPL/2.0/
// </copyright>
// <author>Artak Mkrtchyan</author>
// <email>mkArtak@gmail.com</email>
// <date>24/04/2013</date>
//-----------------------------------------------------------------------
using ConsoleHoster.ViewModel.ControlVM;
using ConsoleHoster.ViewModel.Entities;
using System.Windows;
using System.Windows.Controls;

namespace ConsoleHoster.View.Controls
{
	/// <summary>
	/// Interaction logic for CommandListEditor.xaml
	/// </summary>
	public partial class CommandListEditor : UserControl
	{
		public CommandListEditor()
		{
			InitializeComponent();
		}

		private void btnRemoveCommand_Click(object sender, RoutedEventArgs e)
		{
			CommandDataViewModel argVM = (sender as FrameworkElement).DataContext as CommandDataViewModel;
			this.ViewModel.RemoveCommand(argVM);
		}

		private CommandListDetailsViewModel ViewModel
		{
			get
			{
				return this.DataContext as CommandListDetailsViewModel;
			}
		}
	}
}
